home *** CD-ROM | disk | FTP | other *** search
- regc4f( 5, %daycolor_r, %daycolor_g, %daycolor_b, %sunvisibility )
- regc4f( 7, %ambient_r, %ambient_g, %ambient_b, %ambient_a )
-
- pshader("
-
- ps_1_4
-
- texld r0, t0 ;RGB=terrain colormap, A=terrain lightmap
- texld r1, t1 ;terrain detail
- texld r2, t2 ;detailmasks
- texld r3, t3 ;clouds
- texld r4, t4 ;road
-
- dp3 r1.rgb, r1, r2 ;Mul details with masks = DETAILS
- +mul r0.a, 1-r3.a, r0.a ;clouds shadow * terrain lightmap = CLOUDS&LIGHTMAP
-
- mul r0.rgb, r0, r1 ;terrain color * blended details = R0.RGB terrain
- +mov_x4_sat r3.a, r4.a ;road opacity mask = R3.A road opacity mask
-
- lrp r0.rgb, r3.a, r4, r0 ;terrain color blend road with road opacity mask = terrain & road
- +mul_sat r1.a, r4_bx2.a, c5.a ;specular mask extraction
-
- mul r1.a, r1.a, r0.a ;specular mask * static lighting = R1.A Mask for specular
-
- mad_sat r0.rgb, v1, r1.a, r0 ;add specular
- +mad_sat r0.a, r0.a, c7.b, c7.a ;ambient + static lighting = R0.A static lighting
-
- mul r3.rgb, r0.a, c5 ;day * static lighting = R4.RGB world lighting
-
- mul r0, r0, r3 ;light color
-
- ")
-
-